<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="page">
<body>
<div th:fragment="pager">

    <ul  class="pagination">
    <div th:if="${(page.totalPages le 10) and (page.totalPages gt 0)}" th:remove="tag">
        <div th:each="pg : ${#numbers.sequence(0, page.totalPages - 1)}" th:remove="tag">
            <span th:if="${pg eq page.getNumber()}" th:remove="tag">
                <li class="active"><span class="current_page line_height" th:text="${pg+1}">${pageNumber+1}</span></li>
            </span>
            <span th:unless="${pg eq page.getNumber()}" th:remove="tag">
                <li><a href="#" th:href="@{${pageUrl}(page=${pg+1})}" th:text="${pg+1}"></a></li>
            </span>
        </div>
    </div>

    <li th:if="${page.hasNext()}"><a href="#" th:href="@{${pageUrl}(page=${page.number+2})}">下一页</a></li>
    <li><a href="#" th:href="${page.totalPages le 0 ? pageUrl+'page=0':pageUrl+'&amp;page='+(page.totalPages)}">尾页</a></li>
    <li><span th:utext="'共'+${page.totalPages}+'页 / '+${page.totalElements}+' 条'"></span></li>

    </ul>
</div>
</body>
</html>